import 'package:base_lib/app.dart';
import 'package:base_lib/common/bus/ibus.dart';
import 'package:base_lib/router/page_builder.dart';
import 'package:doctor_app/events.dart';
import 'package:doctor_app/main_page/page.dart';
import 'package:doctor_app/qr_card_page/qr_card_page.dart';
import 'package:doctor_app/splash_page.dart';

import 'home_page/page.dart';
import 'mine_page/page.dart';

class AppComponent extends IComponent {
  static const String AppPackageName = 'AppComponent';
  static final String splashPage = "$AppPackageName/splash";
  static final String mainPage = "$AppPackageName/";
  static final String homePage = "$AppPackageName/home";
  static final String minePage = "$AppPackageName/mine";

  static final String qrCardPage = "$AppPackageName/qrCardPage";

  @override
  void doComponentInitConfig() {}

  @override
  List<EventBuilder> gePublicEvents() {
    return [
      EventBuilder(componentName, "root", rootEvent),
    ];
  }

  @override
  getComponentName() {
    return "AppComponent";
  }

  @override
  List<PageBuilder> getPages() {
    return [
      PageBuilder(splashPage, (param) {
        return SplashPage();
      }),
      PageBuilder(mainPage, (param) {
        return MainPage(param);
      }),
      PageBuilder(homePage, (param) {
        return HomePage(param);
      }),
      PageBuilder(minePage, (param) {
        return MinePage(param);
      }),
      PageBuilder(qrCardPage, (param) {
        return QrCardPage(param);
      }),
    ];
  }
}
